// Lopez-Cordova and Meissner 2008 WP

// REPLICATION
// Pre-WWI period: 1870-1910
clear
use "LCM2008 WP Rep Data Prewar.dta"
display c(k)
mdesc
tabmiss
codebook country1
codebook year

// Table 5
ivreg polity (open2 = openhyby ) lpop larea if year==1870 , robust
codebook country1 if e(sample)

ivreg polity (open2 = openhyby ) lpop larea if year==1875 , robust 
codebook country1 if e(sample)

ivreg polity (open2 = openhyby ) lpop larea if year==1880 , robust 
codebook country1 if e(sample)

ivreg polity (open2 = openhyby ) lpop larea if year==1885 , robust 
codebook country1 if e(sample)

ivreg polity (open2 = openhyby ) lpop larea if year==1890 , robust 
codebook country1 if e(sample)

ivreg polity (open2 = openhyby ) lpop larea if year==1895 , robust 
codebook country1 if e(sample)

ivreg polity (open2 = openhyby ) lpop larea if year==1900 , robust 
codebook country1 if e(sample)

ivreg polity (open2 = openhyby ) lpop larea if year==1905 , robust 
codebook country1 if e(sample)

ivreg polity (open2 = openhyby ) lpop larea if year==1910 , robust 
codebook country1 if e(sample)

// Interwar period: 1920-1938
clear
use "LCM2008 WP Rep Data Interwar.dta"
summarize
display c(k)
mdesc
tabmiss
codebook country
codebook year

// Table 5
ivreg polity (openppp = openppphyby ) lpop lnarea1 if year==1920 , robust 
codebook country if e(sample)

ivreg polity (openppp = openppphyby ) lpop lnarea1 if year==1925 , robust 
codebook country if e(sample)

ivreg polity (openppp = openppphyby ) lpop lnarea1 if year==1928 , robust 
codebook country if e(sample)

ivreg polity (openppp = openppphyby ) lpop lnarea1 if year==1932 , robust 
codebook country if e(sample)

ivreg polity (openppp = openppphyby ) lpop lnarea1 if year==1935 , robust 
codebook country if e(sample)

ivreg polity (openppp = openppphyby ) lpop lnarea1 if year==1938 , robust 
codebook country if e(sample)

// Postwar period: 1960-2000
clear
use "LCM2008 WP Rep Data Postwar.dta"
summarize
display c(k)
mdesc
tabmiss
codebook wb
gen elgdppckd = exp(lgdppckd)
summarize

// Table 5
ivreg polity (openppp = openppphyby ) lpopwdi larea if year==1960 , robust cluster(wb)
sum openppp if e(sample), detail
codebook wb if e(sample)

ivreg polity (openppp = openppphyby ) lpopwdi larea if year==1965 , robust cluster(wb)
codebook wb if e(sample)

ivreg polity (openppp = openppphyby ) lpopwdi larea if year==1970 , robust cluster(wb)
codebook wb if e(sample)

ivreg polity (openppp = openppphyby ) lpopwdi larea if year==1975 , robust cluster(wb)
codebook wb if e(sample)

ivreg polity (openppp = openppphyby ) lpopwdi larea if year==1980 , robust cluster(wb)
codebook wb if e(sample)

ivreg polity (openppp = openppphyby ) lpopwdi larea if year==1985 , robust cluster(wb)
codebook wb if e(sample)

ivreg polity (openppp = openppphyby ) lpopwdi larea if year==1990 , robust cluster(wb)
codebook wb if e(sample) 

ivreg polity (openppp = openppphyby ) lpopwdi larea if year==1995 , robust cluster(wb)
codebook wb if e(sample)

ivreg polity (openppp = openppphyby ) lpopwdi larea if year==2000 , robust cluster(wb)
codebook wb if e(sample)

// IMPUTATION
// Pre-war period
clear
use "LCM2008 WP Imp Data Prewar.dta"
summarize

mi import flong, m(imp) id(country1 year) imp(polity franchise-openhyby_llandlabor)

// Table 5
mi estimate, cmdok post: ivreg polity (open2 = openhyby ) lpop larea if year==1870 , robust

mi estimate, cmdok post: ivreg polity (open2 = openhyby ) lpop larea if year==1875 , robust 

mi estimate, cmdok post: ivreg polity (open2 = openhyby ) lpop larea if year==1880 , robust 

mi estimate, cmdok post: ivreg polity (open2 = openhyby ) lpop larea if year==1885 , robust 

mi estimate, cmdok post: ivreg polity (open2 = openhyby ) lpop larea if year==1890 , robust 

mi estimate, cmdok post: ivreg polity (open2 = openhyby ) lpop larea if year==1895 , robust 

mi estimate, cmdok post: ivreg polity (open2 = openhyby ) lpop larea if year==1900 , robust 

mi estimate, cmdok post: ivreg polity (open2 = openhyby ) lpop larea if year==1905 , robust 

mi estimate, cmdok post: ivreg polity (open2 = openhyby ) lpop larea if year==1910 , robust 

// Interwar period
clear
use "LCM2008 WP Imp Data Interwar.dta"
summarize

mi import flong, m(imp) id(country year) imp(democ-openppphyby_lareapop)

mi xtset, clear

// Table 5

mi estimate, cmdok post: ivreg polity (openppp = openppphyby ) lpop lnarea1 if year==1920 , robust 

mi estimate, cmdok post: ivreg polity (openppp = openppphyby ) lpop lnarea1 if year==1925 , robust 

mi estimate, cmdok post: ivreg polity (openppp = openppphyby ) lpop lnarea1 if year==1928 , robust 

mi estimate, cmdok post: ivreg polity (openppp = openppphyby ) lpop lnarea1 if year==1932 , robust 

mi estimate, cmdok post: ivreg polity (openppp = openppphyby ) lpop lnarea1 if year==1935 , robust 

mi estimate, cmdok post: ivreg polity (openppp = openppphyby ) lpop lnarea1 if year==1938 , robust 

// Postwar period
clear
use "LCM2008 WP Imp Data Postwar.dta"
summarize

mi import flong, m(imp) id(wb year) imp(polity-lgdppckd abslatitude-openh8)

// Table 5

mi estimate, cmdok post: ivreg polity (openppp = openppphyby ) lpopwdi larea if year==1960 , robust cluster(wb)

mi estimate, cmdok post: ivreg polity (openppp = openppphyby ) lpopwdi larea if year==1965 , robust cluster(wb)

mi estimate, cmdok post: ivreg polity (openppp = openppphyby ) lpopwdi larea if year==1970 , robust cluster(wb)

mi estimate, cmdok post: ivreg polity (openppp = openppphyby ) lpopwdi larea if year==1975 , robust cluster(wb)

mi estimate, cmdok post: ivreg polity (openppp = openppphyby ) lpopwdi larea if year==1980 , robust cluster(wb)

mi estimate, cmdok post: ivreg polity (openppp = openppphyby ) lpopwdi larea if year==1985 , robust cluster(wb)

mi estimate, cmdok post: ivreg polity (openppp = openppphyby ) lpopwdi larea if year==1990 , robust cluster(wb)

mi estimate, cmdok post: ivreg polity (openppp = openppphyby ) lpopwdi larea if year==1995 , robust cluster(wb)

mi estimate, cmdok post: ivreg polity (openppp = openppphyby ) lpopwdi larea if year==2000 , robust cluster(wb)
